package com.android.lovely.api.service

import com.airbnb.lottie.L
import com.android.lovely.api.ApiResp
import com.android.lovely.api.manager.HttpManager
import com.android.lovely.data.CardWrapper
import com.android.lovely.data.ChatHistoryList
import com.android.lovely.data.LifecycleInfo
import com.android.lovely.data.LovelyLifecycle
import com.android.lovely.data.LovelyTask
import com.android.lovely.data.MyCardBean
import com.android.lovely.data.RemoteCardItem
import com.android.lovely.data.RemoteCardPackage
import com.android.lovely.data.RoleHistory
import com.android.lovely.data.Preferential
import com.android.lovely.data.Share
import com.android.lovely.data.SignResponse
import com.android.lovely.data.SysMsg
import com.android.lovely.data.TransactionListBean
import com.android.lovely.data.UpdateUserLogin
import com.android.lovely.data.UserBean
import com.android.lovely.room.chat.database.CacheMessage
import retrofit2.http.Body
import retrofit2.http.POST
import retrofit2.http.Query

val userService = HttpManager.createApi<UserService>()

interface UserService {
    @POST("u/login")
    suspend fun signIn(@Body request: Map<String, @JvmSuppressWildcards Any>): Map<String, Any>

    @POST("u/update")
    suspend fun updateUserInfo(@Body params: UpdateUserLogin): UserBean

    @POST("u/info")
    suspend fun refreshUser(): UserBean

    @POST("u/name")
    suspend fun getNames(): Map<String, List<String>>

    @POST("u/chatting_list")
    suspend fun getChatHistory(@Body params: Map<String, Int>): List<ChatHistoryList>

    @POST("u/my_collect_list")
    suspend fun getCollect(@Body params: Map<String, Int>): List<ChatHistoryList>

    @POST("u/rank_list")
    suspend fun getHearList(@Body params: Map<String, Int>): List<ChatHistoryList>

    @POST("u/read_all_message")
    suspend fun readAll(): Any

    @POST("u/my_chat_history_list")
    suspend fun getMessage(@Body params: Map<String, Int>): List<CacheMessage>

    @POST("u/bot_new_message_num")
    suspend fun queryNewMessageCount(@Body params: Map<String, Int>): Map<String, Int>

    @POST("u/collect")
    suspend fun collect(@Body params: Map<String, Int>): Any

    @POST("bot/del_all_chat")
    suspend fun reset(@Body params: Map<String, Int>): Any

    @POST("u/sign_list")
    suspend fun getSignList(): SignResponse

    @POST("u/sign")
    suspend fun checkInDaily(@Body params: Map<String, Int>): Map<String, Int>?

    @POST("u/get_point")
    suspend fun getReward(@Body params: Map<String, String>): Map<String, Int>

    @POST("u/report")
    suspend fun suggestion(
        @Body params: Map<String, @JvmSuppressWildcards Any>
    ): ApiResp<Any>

    @POST("u/report_v2")
    suspend fun reportV2(@Body params: Map<String, @JvmSuppressWildcards Any>): Any

    @POST("u/message_list_v2")
    suspend fun getSysMsg(@Body params: Map<String, Int>): Map<String, List<SysMsg>>

    @POST("u/message_unread_num")
    suspend fun pushUnreadCount(): Map<String, Int>

    @POST("u/read_all_message")
    suspend fun readAllPush(): ApiResp<Any>

    @POST("u/del_message")
    suspend fun deleteSystemPush(@Body params: Map<String, Int>): ApiResp<Any>

    @POST("u/message_detail")
    suspend fun getSystemPushDetail(@Body params: Map<String, Int>): Any?

    @POST("u/my_card_list")
    suspend fun getCollectCards(@Body params: Map<String, Int>): List<MyCardBean>


    @POST("u/message_unread_num")
    suspend fun hasNewSysMessage(): Map<String, Int>

    @POST("u/bind_email")
    suspend fun bindEmail(@Body params: Map<String, String>): Any?

    @POST("u/reset_pd")
    suspend fun changePwd(@Body params: Map<String, @JvmSuppressWildcards Any>): ApiResp<Any?>

    @POST("u/del")
    suspend fun deleteAccount(@Body params: Map<String, String> = emptyMap()): Any?

    @POST("u/v2/task_list")
    suspend fun getTaskList(@Body params: Map<String, String> = emptyMap()): List<LovelyTask>

    @POST("u/get_code_info")
    suspend fun getInviteInfo(@Body params: Map<String, String> = emptyMap()): Share

    @POST("u/write_code")
    suspend fun writeInviteCode(@Body params: Map<String, String> = emptyMap()): Map<String, Int>

    @POST("common/vip_page_info")
    suspend fun getLovelyLifecycle(@Body params: Map<String, String> = emptyMap()): List<LovelyLifecycle>

    @POST("common/vip_product_id")
    suspend fun getLifecycleInfo(@Body params: Map<String, String> = emptyMap()): LifecycleInfo

    @POST("u/report_buy_vip")
    suspend fun reportVip(@Body params: Map<String, String> = emptyMap()): Any

    @POST("u/get_act_list")
    suspend fun getDiscountInfo(@Body params: Map<String, String> = emptyMap()): Preferential

    @POST("u/deal_act_item")
    suspend fun reportPerferential(@Body params: Map<String, @JvmSuppressWildcards Any>): Any

    @POST("u/edit_one_chat")
    suspend fun modifyChat(@Body params: Map<String, @JvmSuppressWildcards Any>): Any

    @POST("u/set_chat_info")
    suspend fun saveChatInfo(@Body params: Map<String, @JvmSuppressWildcards Any?>): Any

    @POST("task/ai_role_info_cost")
    suspend fun getSmartCost(): Map<String, Int>

    @POST("common/bot_card_config")
    suspend fun getProducerCardConfig(@Body params: Map<String, String> = emptyMap()): CardWrapper

    @POST("user/my_bot_info")
    suspend fun getDraftCards(@Body params: Map<String, Int>): RemoteCardPackage

    @POST("user/create_bot")
    suspend fun createBot(@Body params: Map<String, @JvmSuppressWildcards Any?>): Any

    @POST("user/update_bot")
    suspend fun updateBot(@Body params: Map<String, @JvmSuppressWildcards Any?>): Any

    @POST("u/del_user_role")
    suspend fun deleteRole(@Body params: Map<String, String>): Any

//    @POST("user/my_bot")
//    suspend fun getGenRoles(
//        @Body params: Map<String, Int?>
//    ): Map<String, List<GenerateItem>>

//    @POST("user/author_page")
//    suspend fun getCreatorInfo(
//        @Body params: Map<String, Int?>,
//    ): AuthorInfo

    @POST("user/my_bot")
    suspend fun getMyRoles(@Body params: Map<String, @JvmSuppressWildcards Any?>): Map<String, List<RoleHistory>>

    @POST("u/user_point_record")
    suspend fun getTransactionRecord(@Body params: Map<String, @JvmSuppressWildcards Any?>): List<TransactionListBean>


}